#include "graph.h"
#include<bits/stdc++.h>
const int N=205;
int ans[N],cnt=1,f[N][N];
int dfs()
{
    int c=Color(),fa=LastRoad();
    if(c==)c=++cnt;
    else {Move(fa,c);return c;}
    int len=NumberOfRoads();
    for(int i=1;i<=len;++i)
    {
        if(i==fa)continue;
        int to=dfs(i,c);
        f[c][to]=f[to][c]=1;
    }
    if(fa!=-1)Move(fa,c);return c;
}
void Inspect(int R) 
{
    memset(f,50,sizeof(f));
    dfs();for(int i=2;i<=cnt;++i)f[i][i]=0;
    for(int k=2;k<=cnt;++k)
    {
        for(int i=2;i<=cnt;++i)
        {
            for(int j=2;j<=cnt;++j)
            {
                f[i][j]=min(f[i][j],f[i][k]+f[k][j]);
            }
        }
    }
    for(int i=2;i<=cnt;++i)
    {
        for(int j=i+1;j<=cnt;++j)
        {
            if(f[i][j]<=R)ans[f[i][j]]++;
        }
    }
    for(int i=1;i<=R;++i)Answer(i,ans[i]);
}
